var express = require('express');
var router = express.Router();
var config = require(_ROOT + '/app/config.js');

router.get('/', function(req, res) {
	try {
		res.json(config());
	}
	catch (e) {
		if (app.get('env') === 'development') {
			// TODO Set response error status code.
			res.end(e.toString());
		} else {
			// Redirect the user to error page or show user error.
			res.end('(production) Error while getting configuration file.');
		}
	}
});
router.get('/parse', function(req, res) {
  res.json(config().parse);
});
module.exports = router;